#################################################
# pyramid makefile v2.0
# Markus Wienhoefer
#################################################

# set this to dbg or opt
LIBTYPE ?=opt

DEBUGFLAG =

# path to your osg-config
OSGCONFIG=/usr/local/bin/osg-config

SYSTEM := $(shell uname)

CCFLAGS = $(shell $(OSGCONFIG) --cflags --$(LIBTYPE) Base System $(ADDLIB) GLUT)
LDFLAGS = $(LINK) $(shell $(OSGCONFIG) --libs --$(LIBTYPE) Base System $(ADDLIB) GLUT)

CC = gcc

HEADER=header/


OBJS = pyramid_terasse.o pyramid_torch.o pyramid_particles.o pyramid_room1.o pyramid_room2.o pyramid_entrance.o pyramid_entrance_objects.o pyramid_roompass.o pyramid_roompass_objects.o pyramid_lights.o pyramid_body.o pyramid_rotaryBody.o pyramid.o pyramid_coffin.o pyramid_mosaic.o pyramid_walkerscene.o pyramid_room1_objects.o pyramid_room2_objects.o pyramid_stargate.o

pyramid: ${OBJS}
	${CC} -o pyramid ${DEBUGFLAG} ${CCFLAGS} ${OBJS} ${LDFLAGS} fmod/libfmod-3.75.so

pyramid_entrance.o: pyramid_entrance.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_entrance.cpp
	
pyramid_roompass.o: pyramid_roompass.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_roompass.cpp
	
pyramid_entrance_objects.o: pyramid_entrance_objects.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_entrance_objects.cpp
	
pyramid_roompass_objects.o: pyramid_roompass_objects.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_roompass_objects.cpp

pyramid_lights.o: pyramid_lights.cpp ${HEADER}pyramid_stdinc.h
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_lights.cpp

pyramid_body.o: pyramid_body.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_body.cpp
	
pyramid_terasse.o: pyramid_terasse.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_terasse.cpp

pyramid_room1.o: pyramid_room1.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_room1.cpp

pyramid_room2.o: pyramid_room2.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_room2.cpp
	
pyramid_torch.o: pyramid_torch.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_torch.cpp	

pyramid_rotaryBody.o: pyramid_rotaryBody.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_rotaryBody.cpp
	
pyramid_coffin.o: pyramid_coffin.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_coffin.cpp	
	
pyramid_room1_objects.o: pyramid_room1_objects.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_room1_objects.cpp
	
pyramid_room2_objects.o: pyramid_room2_objects.cpp ${HEADER}pyramid_stdinc.h
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_room2_objects.cpp

pyramid_mosaic.o: pyramid_mosaic.cpp ${HEADER}pyramid_stdinc.h
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_mosaic.cpp

pyramid_stargate.o: pyramid_stargate.cpp ${HEADER}pyramid_stdinc.h
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_stargate.cpp

pyramid_walkerscene.o: pyramid_walkerscene.cpp ${HEADER}pyramid_stdinc.h
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_walkerscene.cpp
	
pyramid_particles.o: pyramid_particles.cpp
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid_particles.cpp	

pyramid.o: pyramid.cpp ${HEADER}pyramid_stdinc.h ${HEADER}pyramid_particles.h ${HEADER}pyramid_terasse.h ${HEADER}pyramid_torch.h ${HEADER}pyramid_room1.h ${HEADER}pyramid_room2.h ${HEADER}pyramid_entrance.h ${HEADER}pyramid_entrance_objects.h ${HEADER}pyramid_roompass.h ${HEADER}pyramid_roompass_objects.h ${HEADER}pyramid_lights.h ${HEADER}pyramid_body.h ${HEADER}pyramid_rotaryBody.h ${HEADER}pyramid_mosaic.h ${HEADER}pyramid_stargate.h ${HEADER}pyramid_walkerscene.h ${HEADER}pyramid_room1_objects.h ${HEADER}pyramid_room2_objects.h
	${CC} ${DEBUGFLAG} ${CCFLAGS} -c pyramid.cpp

clean:
	rm -f pyramid ${OBJS}
	@echo "all cleaned up!"
